package com.zhl.hadoop.cases.phone;

import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Partitioner;
import org.junit.Test;

/**
 * @program: demos
 * @description:
 * @author: 刘振华
 * @create: 2020-10-28 16:41
 **/
public class FlowPartitioner extends Partitioner<Text, PhoneFlow> {

	@Override
	public int getPartition(Text text, PhoneFlow nullWritable, int i) {
		return Integer.parseInt(text.toString().substring(0,3))%135;
	}
}
